<script>
function getAppPicker() {
	return document.getElementsByClassName("popdown-button-container")[0];
}

function toggleAppPicker() {
	if (getAppPicker()) {
		var style = getAppPicker().style;
		var wasHidden = style.display == "none";
		style.display = wasHidden ? "block" : "none";
		selectAppPicker(wasHidden);
	}
}
function selectAppPicker(selected) {
	var btn = document.getElementsByClassName("appsBtn")[0];
	btn.className = selected ? btn.className + " selected" : btn.className.replace(/selected/,"");
}
function hideAppPicker(e) {
	var src = (e && e.srcElement) ? e.srcElement : e;
	while(src){
		if(src.className && src.className.match(/appsBtn|popdown-button-container/)){
			return;
		}
		src = src.parentElement;
	}
	if (getAppPicker()) {
		getAppPicker().style.display = "none";
		selectAppPicker(false);
	}
}
document.body.addEventListener("mousedown", hideAppPicker);
</script>
<div onclick="toggleAppPicker()" tabindex="0" class="gwt-ToggleButton flatButtonHeader appsBtn gwt-ToggleButton-up" role="button" aria-pressed="false">
<img src="" width="24" height="24" class="gwt-Image"></div>